// #ifndef VUE3
import Vue from 'vue'
import App from './App'

// 公共方法
import utils from './utils/utils.js'


// 公共组件
import navTitle from '@/components/navTitle/navTitle.vue'
// Vue.component('mark', mark);


Vue.component('navTitle', navTitle);


import uView from "uview-ui";


Vue.use(uView);
Vue.mixin(
// qshare,
{
	mounted() {
		Vue.prototype.$utils = utils
	}
})
Vue.prototype.$pages = "hello";
Vue.prototype.$onLaunched = new Promise(resolve => {
    Vue.prototype.$isResolve = resolve
})
Vue.config.productionTip = false

Vue.prototype.uniClick = function(data) {
	console.log("到了点击",data)
   if (!data.click) return;
	let click = data.click
	switch(click.type){
		case "diyNavigateTo":
		case "navigateTo":
		const pairs = Object.entries(data.click.params)
		  .map(([key, value]) => {  
		    // 对键和值进行URL编码  
		    const encodedKey = encodeURIComponent(key).replace(/%20/g, '+');  
		    const encodedValue = encodeURIComponent(value).replace(/%20/g, '+');  
		    return `${encodedKey}=${encodedValue}`;  
		  });  
		// 使用'&'连接键值对  
		const query = pairs.join('&');
		 uni.navigateTo({
		 	url:click.url + '&' + query
		 })
		break
	}
}



App.mpType = 'app'

const app = new Vue({
	...App

})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
import App from './App.vue'

export function createApp() {
  const app = createSSRApp(App)
  return {
    app
  }
}
// #endif
